package com.anorak.betsy.entity;

import java.util.ArrayList;
import java.util.List;

/**
 * @author anorak
 */
public class Song {

    private String name;

    private List<String> singerName;

    private String href;

    private String lanZouUrl;

    private String lanZouPassWord;

    private String zipPath;

    private String flacPath;

    private String mp3path;

    public String getZipPath() {
        return zipPath;
    }

    public void setZipPath(String zipPath) {
        this.zipPath = zipPath;
    }

    public String getFlacPath() {
        return flacPath;
    }

    public void setFlacPath(String flacPath) {
        this.flacPath = flacPath;
    }

    public String getMp3path() {
        return mp3path;
    }

    public void setMp3path(String mp3path) {
        this.mp3path = mp3path;
    }

    public String getLanZouUrl() {
        return lanZouUrl;
    }

    public void setLanZouUrl(String lanZouUrl) {
        this.lanZouUrl = lanZouUrl;
    }

    public String getLanZouPassWord() {
        return lanZouPassWord;
    }

    public void setLanZouPassWord(String lanZouPassWord) {
        this.lanZouPassWord = lanZouPassWord;
    }

    public String getHref() {
        return href;
    }

    public void setHref(String href) {
        this.href = href;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<String> getSingerName() {
        if (singerName == null) {
            singerName = new ArrayList<>();
        }
        return singerName;
    }

    public void setSingerName(List<String> singerName) {
        this.singerName = singerName;
    }

    public String getSearchTag() {
        StringBuilder stringBuffer = new StringBuilder(this.name);
        if (!this.getSingerName().isEmpty()) {
            for (String string : this.getSingerName()) {
                stringBuffer.append(" ").append(string);
            }
        }
        return stringBuffer.toString();
    }

    public String getAbsName() {
        StringBuilder stringBuffer = new StringBuilder();
        if (!this.getSingerName().isEmpty()) {
            for (String string : this.getSingerName()) {
                if ( stringBuffer.length() == 0 ){
                    stringBuffer.append(string);
                }else {
                    stringBuffer.append(",").append(string);
                }
            }
        }
        return stringBuffer +" - "+this.name;
    }
}
